package com.kitty.game.gm.handler100;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.equip.message.RespNotifyMiscEx;
import com.kitty.game.equip.service.EquipService;
import com.kitty.game.equip.service.FabaoService;
import com.kitty.game.role.model.Role;
import com.kitty.mina.message.MessagePusher;

public class NCFabao implements NCGmFather {
    @Override
    public void handle(Role role, String content) {
        content = content.trim();
        int xiangxin = 0;
        if (content.contains("(金)")) {
            xiangxin = 1;
        } else if (content.contains("(木)")) {
            xiangxin = 2;
        } else if (content.contains("(水)")) {
            xiangxin = 3;
        } else if (content.contains("(火)")) {
            xiangxin = 4;
        } else if (content.contains("(土)")) {
            xiangxin = 5;
        }
        String equipname = content.substring(3, content.indexOf("("));
        if (content.contains("24级")){
            SpringUtils.getBean(FabaoService.class).getArtifact24(role, equipname, xiangxin);
        }else if (content.contains("18级")){
            SpringUtils.getBean(FabaoService.class).getArtifact18(role, equipname, xiangxin);
        }else if (content.contains("12级")){
            SpringUtils.getBean(FabaoService.class).getArtifact12(role, equipname, xiangxin);
        }else {
            SpringUtils.getBean(EquipService.class).getArtifact(content, role);
        }
        MessagePusher.pushMessage(role,new RespNotifyMiscEx("发送法宝成功！！"));
    }
}
